﻿
Public MustInherit Class _template_parameter(Of T)
    Protected MustOverride Function n() As T

    Public Shared Operator +(ByVal this As _template_parameter(Of T))
        If this Is Nothing Then
            Return Nothing
        Else
            Return this.n()
        End If
    End Operator
End Class

Public MustInherit Class _template_parameter(Of T, RT)
    Protected MustOverride Function at(ByVal k As T) As RT

    Default Public ReadOnly Property _at(ByVal k As T) As RT
        Get
            Return at(k)
        End Get
    End Property

    Public Shared Operator +(ByVal this As _template_parameter(Of T, RT), ByVal k As T) As RT
        If this Is Nothing Then
            Return Nothing
        Else
            Return this(k)
        End If
    End Operator
End Class